package org.ihelpuoo.weboo.checkers;

import java.util.regex.Pattern;

public class ArrayChecker extends AbstractChecker
{
	private Pattern	pattern;

	public boolean isValid(String value)
	{
		if (value.endsWith(","))
			return false;
		String[] ss = value.split(",");
		for (int i = 0; i < ss.length; i++)
			if (!pattern.matcher(ss[i]).matches())
				return false;
		return true;
	}

	public void setSetting(String setting)
	{
		pattern = Pattern.compile(setting);
	}

}
